<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws.
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/modules/Admin/classes/PhpFox_ComponentServerStats.class.php, $Author:  $ */



/** Component for showing server statistics
 *
 *
 * @version $Id: PhpFox_ComponentServerStats.class.php 46 2007-12-14 23:12:21Z phpfoxsv $
 * @package module.admin
 */
class PhpFox_Mod_Admin_ComponentServerStats extends BaseComponent
{
    function process()
    {
        $oSrvAdmin = $this->_oModule->getService('Admin');
        /* @var $oSrvAdmin PhpFox_Mod_Account_ServiceAdmin */

		if ( App::getParam('display_news_feed') )
		{
			$oCache = &App::getCache();
			$oCache->setFile('phpfox_news.php');

			if ( !$oCache->isCached('360') )
			{
        		$oXml = &App::getXml('http://feeds.feedburner.com/phpfox-news?format=xml');
	    	    $aNews = $oXml->getFeedBurner();
				$oCache->save($aNews);
			}

			$aNews = $oCache->doRequire();
		}

        $oTpl = &$this->_oModule->getTemplate();
        $oTpl->assign(array(
            'aServerStats' => $oSrvAdmin->getServerStats(),
			'aNews' => (isset($aNews) ? $aNews : ''),
        ));
        return $oTpl->fetch('ServerStats.html');
    }
}
?>